home *** CD-ROM | disk | FTP | other *** search
- /* --------------------------------- -------
- * |\ | | | | | |.| | \| |/ /|\ |||||||
- * | | | |/ | |\ |/ |/| |\ |/ | ? ---+--- =<
- * | | | | | | | | | | | \qqqqqqqqq/
- * --------------------------------- ~~~~~~~~~~~~~~~~
- * varargs interface to dos.library/VPrintf()
- * Copyright (C) 1993 Torsten Poulin
- *
- * This file is part of "Torsten's AmigaDOS Shell Commands" package.
- * The package is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * The package is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * The author can be contacted by s-mail at
- * Torsten Poulin
- * Banebrinken 99, 2, 77
- * DK-2400 Copenhagen NV
- * DENMARK
- *
- * $Id: myprintf.c,v 1.2 93/03/01 12:58:10 Torsten Rel $
- * $Log: myprintf.c,v $
- * Revision 1.2 93/03/01 12:58:10 Torsten
- * Changed all occurrences of "struct DosBase *" to "struct DosLibrary *"
- *
- * Revision 1.1 93/03/01 11:01:56 Torsten
- * Initial revision
- *
- */
-
- #include <exec/types.h>
- #include <dos/dos.h>
- #include <clib/dos_protos.h>
- #ifdef __SASC
- #include <pragmas/dos_pragmas.h>
- #endif
- #include <stdarg.h>
-
- struct Global {
- struct DosLibrary *DOSBase;
- };
-
- LONG MyPrintf(VOID *global, char *fmt, ...)
- {
- struct DosLibrary *DOSBase = ((struct Global *) global)->DOSBase;
- va_list ap;
- LONG num;
-
- va_start(ap, fmt);
- num = VPrintf(fmt, (LONG *) ap);
- va_end(ap);
- return num;
- }
-